package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.FriendNews;
import cn.wolfcode.trip.base.domain.User;
import cn.wolfcode.trip.base.query.FriendNewsQueryObject;
import cn.wolfcode.trip.base.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public interface UserMapper {
    int deleteByPrimaryKey(Long id);

    int insert(User record);

    User selectByPrimaryKey(Long id);

    List<User> selectAll();

    int updateByPrimaryKey(User record);

    User selectUserByEmailAndPassword(@Param("email") String email, @Param("password") String password);

    User checkEmail(String email);

    List<User> selectForList(QueryObject qo);

    int getTravelNums(Long userId);


    List<Map> selectAllFridends(Long id);

    User selectOneByNickName(String name);

    /**
     * app 当前用户作为主动添加人-->查询的朋友
     * @param id
     * @return
     */
    List<Map> queryByRoleOfInviter(Long id);

    /**
     * app 当前用户作为被添加为好友的人-->查询的朋友
     * @param id
     * @return
     */
    List<Map> queryByRoleOfInvited(Long id);

    /**
     * app 获取多个用户
     * @param ids
     * @return
     */
    List selectManyUsers(@Param("ids") Long[] ids);
    /**
     * app 获取多个用户
     * @param ids
     * @return
     */
    List<User> selectManyUsers2(@Param("ids") Long[] ids);


    /**
     * 查询单个用户的id和nickName,用于回显liker
     * @param currentUserId
     * @return
     */
    Map<String,Object> selectAppearForHtmlLiker(Long currentUserId);
}